Optimal. Leaf size=98 \[ -a^3 x-\frac {13 a^3 \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^3 \tan (c+d x)}{d}+\frac {11 a^3 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a^3 \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {a^3 \tan ^3(c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 8, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3971, 3554, 8,
2691, 3855, 2687, 30, 3853} \begin {gather*} \frac {a^3 \tan ^3(c+d x)}{d}+\frac {a^3 \tan (c+d x)}{d}-\frac {13 a^3 \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^3 \tan (c+d x) \sec ^3(c+d x)}{4 d}+\frac {11 a^3 \tan (c+d x) \sec (c+d x)}{8 d}-a^3 x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2687
Rule 2691
Rule 3554
Rule 3853
Rule 3855
Rule 3971
Rubi steps
\begin {align*} \int (a+a \sec (c+d x))^3 \tan ^2(c+d x) \, dx &=\int \left (a^3 \tan ^2(c+d x)+3 a^3 \sec (c+d x) \tan ^2(c+d x)+3 a^3 \sec ^2(c+d x) \tan ^2(c+d x)+a^3 \sec ^3(c+d x) \tan ^2(c+d x)\right ) \, dx\\ &=a^3 \int \tan ^2(c+d x) \, dx+a^3 \int \sec ^3(c+d x) \tan ^2(c+d x) \, dx+\left (3 a^3\right ) \int \sec (c+d x) \tan ^2(c+d x) \, dx+\left (3 a^3\right ) \int \sec ^2(c+d x) \tan ^2(c+d x) \, dx\\ &=\frac {a^3 \tan (c+d x)}{d}+\frac {3 a^3 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {a^3 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {1}{4} a^3 \int \sec ^3(c+d x) \, dx-a^3 \int 1 \, dx-\frac {1}{2} \left (3 a^3\right ) \int \sec (c+d x) \, dx+\frac {\left (3 a^3\right ) \text {Subst}\left (\int x^2 \, dx,x,\tan (c+d x)\right )}{d}\\ &=-a^3 x-\frac {3 a^3 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a^3 \tan (c+d x)}{d}+\frac {11 a^3 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a^3 \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {a^3 \tan ^3(c+d x)}{d}-\frac {1}{8} a^3 \int \sec (c+d x) \, dx\\ &=-a^3 x-\frac {13 a^3 \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a^3 \tan (c+d x)}{d}+\frac {11 a^3 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a^3 \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {a^3 \tan ^3(c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(230\) vs. \(2(98)=196\).
time = 0.88, size = 230, normalized size = 2.35 \begin {gather*} -\frac {a^3 \sec ^4(c+d x) \left (24 d x-39 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+39 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 \cos (2 (c+d x)) \left (8 d x-13 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+13 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\cos (4 (c+d x)) \left (8 d x-13 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+13 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-38 \sin (c+d x)-32 \sin (2 (c+d x))-22 \sin (3 (c+d x))\right )}{64 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 157, normalized size = 1.60
method | result | size |
risch | \(-a^{3} x -\frac {i a^{3} \left (11 \,{\mathrm e}^{7 i \left (d x +c \right )}+16 \,{\mathrm e}^{6 i \left (d x +c \right )}+19 \,{\mathrm e}^{5 i \left (d x +c \right )}-19 \,{\mathrm e}^{3 i \left (d x +c \right )}-16 \,{\mathrm e}^{2 i \left (d x +c \right )}-11 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{4 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {13 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}-\frac {13 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}\) | \(139\) |
derivativedivides | \(\frac {a^{3} \left (\frac {\sin ^{3}\left (d x +c \right )}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin ^{3}\left (d x +c \right )}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {a^{3} \left (\sin ^{3}\left (d x +c \right )\right )}{\cos \left (d x +c \right )^{3}}+3 a^{3} \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{3} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(157\) |
default | \(\frac {a^{3} \left (\frac {\sin ^{3}\left (d x +c \right )}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin ^{3}\left (d x +c \right )}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {a^{3} \left (\sin ^{3}\left (d x +c \right )\right )}{\cos \left (d x +c \right )^{3}}+3 a^{3} \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{3} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(157\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 147, normalized size = 1.50 \begin {gather*} \frac {16 \, a^{3} \tan \left (d x + c\right )^{3} - 16 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{3} + a^{3} {\left (\frac {2 \, {\left (\sin \left (d x + c\right )^{3} + \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{16 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.12, size = 113, normalized size = 1.15 \begin {gather*} -\frac {16 \, a^{3} d x \cos \left (d x + c\right )^{4} + 13 \, a^{3} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 13 \, a^{3} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (11 \, a^{3} \cos \left (d x + c\right )^{2} + 8 \, a^{3} \cos \left (d x + c\right ) + 2 \, a^{3}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{3} \left (\int 3 \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 \tan ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \tan ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int \tan ^{2}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.82, size = 132, normalized size = 1.35 \begin {gather*} -\frac {8 \, {\left (d x + c\right )} a^{3} + 13 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 13 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (5 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 13 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 21 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.91, size = 146, normalized size = 1.49 \begin {gather*} \frac {\frac {5\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}-\frac {13\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{4}+\frac {3\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{4}+\frac {21\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-a^3\,x-\frac {13\,a^3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________